<?php
namespace App\Models;
use Dcat\Admin\Models\Administrator;

class AdminUser extends Administrator
{
    public function caseCustomers()
    {
        return $this->hasMany(CaseCustomer::class,'admin_user_id');
    }

    public function caseEvents()
    {
        return $this->hasMany(CaseEvent::class,'admin_user_id');
    }

    public function caseContracts()
    {
        return $this->hasManyThrough(CaseContract::class,'App\Models\CaseCustomer','admin_user_id','case_customer_id');
    }

    public function SharesCustomer()
    {
        return $this->belongsToMany(CaseCustomer::class, 'case_shares', 'user_id', 'case_customer_id');
    }

}
